﻿namespace Steamworks
{
    using System;

    internal class CallbackIdentities
    {
        public static int GetCallbackIdentity(Type callbackStruct)
        {
            foreach (CallbackIdentityAttribute attribute in callbackStruct.GetCustomAttributes(typeof(CallbackIdentityAttribute), false))
            {
                return attribute.Identity;
            }
            throw new Exception("Callback number not found for struct " + callbackStruct);
        }
    }
}

